package com.aispeech.asr.comm.enums;

public enum ErrorCode {
    ERR_OK(0, ""),
    ERR_UNKNOWN(1, "internal error"),                     // 服务器内部错误
    ERR_INVALID_AUTHORIZATION(4, "invalid Authorization"), // 基于token的验证失败
    ERR_PARAMS_MISSED(10, ""),                            // 客户端参数缺失
    ERR_OVER_CONCURRENCIES_LIMIT(30, "over concurrencies limit"), // 客户端参数缺失

    ERR_TASK_LOAD_FAILED(101, ""),                        // 查询任务信息失败
    ERR_TASK_CREATE_FAILED(102, ""),                      // 创建任务失败
//    ERR_TASK_UPDATE_FAILED(103, ""),                      // 更新任务信息失败

    ERR_AUDIO_DOWNLOAD_FAILED(201, ""),                   // 音频下载失败
    ERR_AUDIO_SPLIT_FAILED(202, ""),                      // 音频切割失败
    
    ERR_AUDIO_CHANNEL_SPLIT_FAILED(204, "only support audio type: ogg_opus"),              // 音频通道分离异常

    ERR_AUDIO_CREATE_FAILED(210, ""),                      // 创建音频失败
    ERR_AUDIO_UNEXPECT_SLICE(211, ""),                      // 非期望的音频分片
    ERR_AUDIO_SIZE_TOO_SMALL(212, ""),                      // 创建音频失败
    ERR_AUDIO_SIZE_TOO_LARGE(213, ""),                      // 创建音频失败

    ERR_AUDIO_NOT_EXITST(501, ""),                        // 要加载的音频文件不存在
    ERR_ASR_FAILED(502, ""),
    ERR_SSC_FAILED(510, ""),                              // 说话人聚类错误
    
    ERR_VPR_FAILED(601, "VPR error"), 
    ERR_AUDIO_PREPARE_FAILED(602, "audio prepare"),
    ERR_AUDIO_PARAGRAPH_FAILED(603, "Paragraph"),

    ERR_CONTROLL_INFO_FAILED(701, "query info failed"),   // 失败异常
    ERR_CONTROLL_INTERRUPTED(702, "taskid been interruped"),   //任务被管理员中止
    ERR_CONTROLL_TASK_NOT_FOUND(703, "task not found"),   // 失败异常
    ERR_CONTROLL_MISS_PARAM(711, "missed param: customerId"),   // OCS
    ;

    public int errid;
    public String error;

    ErrorCode(int errid, String error) {
        this.errid = errid;
        this.error = error;
    }

    public void updateError(String error) {
        this.error = error;
    }
}
